(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/address-detail/address-detail" ], {
    "073d": function(e, n, t) {
        (function(e) {
            function n(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            t("8163"), n(t("66fd")), e(n(t("0af8")).default);
        }).call(this, t("543d").createPage);
    },
    "0af8": function(e, n, t) {
        t.r(n);
        var o, a = t("cc4b"), c = t("f072");
        for (o in c) "default" !== o && function(e) {
            t.d(n, e, function() {
                return c[e];
            });
        }(o);
        t("c611");
        var s = t("f0c5"), a = Object(s.a)(c.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        n.default = a.exports;
    },
    "482d": function(e, n, t) {},
    c611: function(e, n, t) {
        var o = t("482d");
        t.n(o).a;
    },
    c854: function(e, t, o) {
        (function(c) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var e, s = (e = o("4795")) && e.__esModule ? e : {
                default: e
            };
            function l(e, n, t, o, a, c, s) {
                try {
                    var i = e[c](s), l = i.value;
                } catch (e) {
                    return t(e), 0;
                }
                i.done ? n(l) : Promise.resolve(l).then(o, a);
            }
            function i(i) {
                return function() {
                    var e = this, s = arguments;
                    return new Promise(function(n, t) {
                        var o = i.apply(e, s);
                        function a(e) {
                            l(o, n, t, a, c, "next", e);
                        }
                        function c(e) {
                            l(o, n, t, a, c, "throw", e);
                        }
                        a(void 0);
                    });
                };
            }
            var n = {
                data: function() {
                    return {
                        obj: {
                            id: "",
                            consignee: "",
                            consignee_phone: "",
                            location: "",
                            detail: "",
                            is_default: 2
                        },
                        lng: "",
                        lat: ""
                    };
                },
                onShow: function() {},
                onLoad: function(e) {
                    this.obj.id = e.addId, e.addId && this.detailAdd();
                },
                methods: {
                    bindPickerChange: function(e) {
                        this.obj.location = e.detail.value[0] + "-" + e.detail.value[1] + "-" + e.detail.value[2];
                    },
                    switch1Change: function(e) {
                        console.log("switch1 发生 change 事件，携带值为", e.target.value), e.target.value ? this.obj.is_default = 1 : this.obj.is_default = 2;
                    },
                    detailAdd: function() {
                        var t = this;
                        return i(s.default.mark(function e() {
                            var n;
                            return s.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, t.$http({
                                        url: t.$api.addressDetail,
                                        data: {
                                            id: t.obj.id
                                        }
                                    });

                                  case 2:
                                    0 == (n = e.sent).errno && (t.obj = n.data, t.lng = n.data.lng, t.lat = n.data.lat, 
                                    console.log("地址详情", n.data, t.lng, t.lat));

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    chooseLocation: function() {
                        var n, t, o = this, a = this;
                        console.log("经纬度", a.lat, a.lng), this.obj.id ? c.getLocation({
                            latitude: a.lat,
                            longitude: a.lng,
                            success: (t = i(s.default.mark(function e(n) {
                                return s.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        console.log("ret", n), c.chooseLocation({
                                            latitude: a.lat,
                                            longitude: a.lng,
                                            success: function(e) {
                                                console.log("res", e), console.log("位置名称：" + e.name), console.log("详细地址：" + e.address), 
                                                console.log("纬度：" + e.latitude), console.log("经度：" + e.longitude), a.lng = e.longitude, 
                                                a.lat = e.latitude, o.obj.location = e.address, console.log("111111111111", a.lng, a.lat);
                                            }
                                        });

                                      case 2:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return t.apply(this, arguments);
                            }),
                            fail: function(e) {
                                c.showModal({
                                    title: "温馨提示",
                                    content: "您已拒绝定位,请开启",
                                    confirmText: "去设置",
                                    success: function(e) {
                                        e.confirm && openSetting();
                                    }
                                });
                            }
                        }) : c.getLocation({
                            success: (n = i(s.default.mark(function e(n) {
                                return s.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        console.log("ret", n), c.chooseLocation({
                                            success: function(e) {
                                                console.log("res", e), console.log("位置名称：" + e.name), console.log("详细地址：" + e.address), 
                                                console.log("纬度：" + e.latitude), console.log("经度：" + e.longitude), a.lng = e.longitude, 
                                                a.lat = e.latitude, o.obj.location = e.address, console.log("111111111111", a.lng, a.lat);
                                            }
                                        });

                                      case 2:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return n.apply(this, arguments);
                            }),
                            fail: function(e) {
                                c.showModal({
                                    title: "温馨提示",
                                    content: "您已拒绝定位,请开启",
                                    confirmText: "去设置",
                                    success: function(e) {
                                        e.confirm && openSetting();
                                    }
                                });
                            }
                        });
                    },
                    addressCheck: function(e, t) {
                        var o = this;
                        return i(s.default.mark(function e() {
                            var n;
                            return s.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, o.$http({
                                        url: o.$api.addressCheck,
                                        data: {
                                            lng: o.lng,
                                            lat: o.lat
                                        }
                                    });

                                  case 2:
                                    n = e.sent, console.log("判断位置是否在区域范围内", n, n.data), 0 == n.errno && (o.obj.location = t, 
                                    console.log("eeeeeeeeeeeeee", o.obj.location));

                                  case 5:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    deleteAdd: function() {
                        var n, o = this;
                        c.showModal({
                            title: "提示",
                            content: "确认删除该地址？",
                            success: (n = i(s.default.mark(function e(n) {
                                var t;
                                return s.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        if (n.confirm) return e.next = 3, o.$http({
                                            url: o.$api.addressDel,
                                            data: {
                                                id: o.obj.id
                                            }
                                        });
                                        e.next = 7;
                                        break;

                                      case 3:
                                        0 == (t = e.sent).errno && (console.log(t), c.showModal({
                                            title: "提示",
                                            showCancel: !1,
                                            content: t.message,
                                            success: function(e) {
                                                if (e.confirm) c.navigateBack(); else if (e.cancel) return;
                                            }
                                        })), e.next = 8;
                                        break;

                                      case 7:
                                        n.cancel && console.log("用户点击取消");

                                      case 8:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return n.apply(this, arguments);
                            })
                        });
                    },
                    sub: function() {
                        var o = this;
                        return i(s.default.mark(function e() {
                            var n, t;
                            return s.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    if (n = !0, o.obj.consignee) {
                                        e.next = 5;
                                        break;
                                    }
                                    return o.$sun.toast("请输入姓名"), n = !1, e.abrupt("return");

                                  case 5:
                                    if (o.$sun.checkPhone(o.obj.consignee_phone)) {
                                        e.next = 9;
                                        break;
                                    }
                                    return o.$sun.toast("请输入正确的手机号码"), n = !1, e.abrupt("return");

                                  case 9:
                                    if (o.obj.detail) {
                                        e.next = 13;
                                        break;
                                    }
                                    return o.$sun.toast("请输入详细地址"), n = !1, e.abrupt("return");

                                  case 13:
                                    if (n) return e.next = 16, o.$http({
                                        url: o.$api.addressEdit,
                                        data: {
                                            id: o.obj.id || "",
                                            uid: c.getStorageSync("uid"),
                                            consignee: o.obj.consignee,
                                            consignee_phone: o.obj.consignee_phone,
                                            location: o.obj.location,
                                            detail: o.obj.detail,
                                            lng: o.lng,
                                            lat: o.lat,
                                            is_default: o.obj.is_default
                                        }
                                    });
                                    e.next = 18;
                                    break;

                                  case 16:
                                    0 == (t = e.sent).errno ? (console.info(o.id), c.showModal({
                                        title: "提示",
                                        showCancel: !1,
                                        content: t.message,
                                        success: function(e) {
                                            if (e.confirm) c.navigateBack(); else if (e.cancel) return;
                                        }
                                    })) : o.$sun.toast(t.message);

                                  case 18:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    }
                }
            };
            t.default = n;
        }).call(this, o("543d").default);
    },
    cc4b: function(e, n, t) {
        function o() {
            this.$createElement, this._self._c;
        }
        var a = [];
        t.d(n, "b", function() {
            return o;
        }), t.d(n, "c", function() {
            return a;
        }), t.d(n, "a", function() {});
    },
    f072: function(e, n, t) {
        t.r(n);
        var o, a = t("c854"), c = t.n(a);
        for (o in a) "default" !== o && function(e) {
            t.d(n, e, function() {
                return a[e];
            });
        }(o);
        n.default = c.a;
    }
}, [ [ "073d", "common/runtime", "common/vendor" ] ] ]);